#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>

void
reverse_line(char* line)
{
	char dup[202];
	char *wstart = line, *wfin;
	int i = 0, i_dup = 0;
	do {
		if ( isalpha(*(line + i)) ) {
			dup[i_dup++] = *(line + i);
			++i;
		} else {
			while (--i_dup >= 0) {
				*wstart++ = dup[i_dup]; /* hurrah for pointers */
			}
			i_dup = 0;
			wstart = line + i + 1;
			++i;
		}
	} while (*(line + i - 1) != '\0');
}

int
main()
{
	char line[202];
	freopen("contra.in", "r", stdin);
	freopen("contra.out", "w", stdout);

	while (gets(line) != NULL) {
		reverse_line(line);
		printf("%s\n", line);
	}
	return 0;
}
